package com.sxm.yiwei.tools;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

/**
 *
 * Created by KuKa on 2017/8/1.
 *
 */

public class MySqHelper extends SQLiteOpenHelper {

    public MySqHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);

    }

    public MySqHelper(Context context){

        super(context,SqData.DATABASE_NAME,null,SqData.DATABASE_VERSION);

    }

    @Override
    public void onCreate(SQLiteDatabase db) {

        String sqlm = "create table  yivim(_id integer primary key  autoincrement ,title varchar(255) ,message title varchar(255) ,time varchar(255));";
        String sqlc = "create table yivic(_id integer primary key  autoincrement ,oid varchar(255) ,amount varchar(255) ,time varchar(255) ,intro text ,code varchar(255) ,type integer);";
        db.execSQL(sqlm);
        db.execSQL(sqlc);
    }


    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }

    @Override
    public void onOpen(SQLiteDatabase db) {
        super.onOpen(db);

    }
}
